<?php

namespace app\common\validate;

use think\Validate;

class Car extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
        'car_name' => 'required',
        'car_image' => 'required',
        'car_site' => 'required',
        'car_gate' => 'required',
        'car_gear' => 'required',
        'car_introduction' => 'required',
    ];
    /**
     * 提示消息
     */
    protected $message = [
        'car_name.required' => '车辆名称不能为空',
        'car_image.required' => '车辆主图不能为空',
        'car_site.required' => '座位数不能为空',
        'car_gate.required' => '车门数不能为空',
        'car_gear.required' => '档位不能为空',
        'car_introduction.required' => '车辆简介不能为空',
    ];
    /**
     * 验证场景
     */
    protected $scene = [
        'add'  => ['car_name', 'car_image', 'car_site', 'car_gate', 'car_gear', 'car_introduction'],
        'edit' => ['car_name', 'car_image', 'car_site', 'car_gate', 'car_gear', 'car_introduction'],
    ];
    
}
